package com.wenhui.nzapp.ui.fragment.main;

import static java.math.BigDecimal.ROUND_HALF_UP;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.fragment.app.Fragment;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gzwh.weblib.bean.NzSysPayLog;
import com.gzwh.weblib.bean.Result;
import com.gzwh.weblib.utils.MyObserver;
import com.gzwh.weblib.utils.RequestUtils;
import com.wenhui.nzapp.R;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public class HomeFragment extends Fragment {

    private Context mContext;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_home, container, false);
        mContext = view.getContext();
        return view;
    }

    @Override
    public void onResume() {
        super.onResume();
        RequestUtils.getHome(mContext, new MyObserver<JSONObject>(mContext, false) {
            @Override
            public void onSuccess(Result<JSONObject> result) {


                System.out.println("zz:" + result.getResult().getJSONArray("payLog").getJSONObject(0).getString("orders"));


            }

            @Override
            public void onFailure(Throwable e, String errorMsg) {

            }
        });
    }
}
